/*
 * Copyright (c) 2010 Philip Foulkes <philip.foulkes@gmail.com>
 *
 * This file is free software and is made available under the 
 * terms of the GNU General Public License, version 2, or at your
 * option, any later version
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#ifndef _MRP_MAP_H__
#define _MRP_MAP_H__

struct mrp_map
{
	struct list_head mrps;
    spinlock_t mrps_lock;
    
    struct mrp * mrp;
};

int mrp_map_init(struct mrp_map * mar_map);
void mrp_map_cleanup(struct mrp_map * mrp_map);

struct mrp_map * mrp_map_create_and_init(void);
void mrp_map_destroy(struct mrp_map ** mrp_map);

/**
 * Set the parent MRP
 */
void mrp_map_set_mrp(struct mrp_map * mrp_map, struct mrp * mrp);

/**
 * Add/remove neighbouring MRPs
 */
int mrp_map_add_mrp(struct mrp_map * mrp_map, struct mrp * mrp);
int mrp_map_remove_mrp(struct mrp_map * mrp_map, struct mrp * mrp);

#endif
